import random
from Solution import Solution

def numberOf1(n):
        count = 0
        n = n & 0xffffffffffffffff
        while n:
            count += n & 1
            n = n >> 1
        return count

s = Solution()
numbers = [random.randrange(-9223372036854775808, 9223372036854775807) for i in range(993)]
numbers.extend([-2, -1, 0, 1, 2, -9223372036854775808, 9223372036854775807])
for i in range(1000):
    number = numbers[i]
    a = s.answer(number)
    e = numberOf1(number)
    if a != e:
        print("Test Failed\nInput:", number, "Expected:", e, "Got:", a)
        exit(1)

exit(0)